calculate discounts by hand